/** 禁止 iOS 的 elastic scrolling 的 bounce effect  */
let wrap = document.getElementById('wrap');
wrap.addEventListener('scroll.elasticity', function (e) {
    e.preventDefault();
}, false);
wrap.addEventListener('touchmove.elasticity', function (e) {
    e.preventDefault();
}, false);
wrap.addEventListener('touchmove', function (e) {
    e.preventDefault();
}, false);
document.getElementById('ourCanvas').addEventListener('contextmenu', function (e) {alert(1);
    e.preventDefault();
}, false);

function getCookie(name) {
    var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
    if (arr = document.cookie.match(reg))
        return unescape(arr[2]);
    else
        return "";
}

function setCookie(name, value) {
    var Days = 30;
    var exp = new Date();
    exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
    document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
}